package com.mask.mq.consumer;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author hx
 * @since 2021/11/21 2:12 下午
 */

@Component
@Slf4j
public class TopicReceive {

    @RabbitListener(queues = "topic1")
    public void demo1(String message){
        log.info("topic1 接收消息:{}",message);
    }

    @RabbitListener(queues = "topic2")
    public void demo2(String message) {
        log.info("topic2 接收消息:{}",message);
    }
}
